package io.renren.modules.jxgkphone.service.Impl;

import io.renren.modules.jxgkphone.dao.ElectiveCourseEvaluationDao;
import io.renren.modules.jxgkphone.entity.ElectiveCourse;
import io.renren.modules.jxgkphone.entity.TeachingEvaluation;
import io.renren.modules.jxgkphone.service.ElectiveCourseEvaluationService;
import io.renren.modules.jxgkphone.tempEntity.TempTeachingEvaluation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ElectiveCourseEvaluationServiceImpl implements ElectiveCourseEvaluationService {
    @Autowired
    ElectiveCourseEvaluationDao electiveCourseEvaluationDao;
    @Override
    public List<ElectiveCourse> getElectiveCourseList(String username) {


        return electiveCourseEvaluationDao.getElectiveCourseList(username);
    }

    @Override
    public void saveElectiveCoursEvaluation(TempTeachingEvaluation[] te) {
        if(te.length>0)
        {
            electiveCourseEvaluationDao.updateElectiveCourse(te[0].getId());
            electiveCourseEvaluationDao.insertElectiveCourseEvaluation(te);
        }

    }
}
